package com.example;

import com.example.controller.RedisTester;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableCaching
public class Les005RedisApplication {

    public static void main(String[] args) {


        ConfigurableApplicationContext context = SpringApplication.run(Les005RedisApplication.class, args);

        RedisTester redisTester = context.getBean(RedisTester.class);

        for (int i = 0; i < 5; i++) {
            new Thread(() -> {

                redisTester.testSetnx();

            }).start();
        }


    }

}
